$(document).ready(function(){
	initGrid({
		url: 'getJson.json'
	});
	
	addSubmit();
	showEditModal('staff');
});
function initGrid(options){
	
	var colModel = [
	                { label: '序号', name: 'id', key: true, fixed:true, width: 55 },
	                { label: '员工号', name: 'code', width: 150 },
	                { label: '姓名', name: 'name', width: 150 },
	                { label: '性别', name: 'sex', width: 30 },
	                { label: '婚姻状况', name: 'marital', width: 30, formatter:function(cellValue, options, rowObject){
	                	if(cellValue == 0){
	                		return '未婚';
	                	}else{
	                		return '已婚';
	                	}
	                } },
	                { label: '所在部门', name: 'department.name', index:'department_code', width: 150 },
	                { label: '联系电话', name: 'departmentPhone', width: 150, formatter: function(cellValue, options, rowObject){
	                	return rowObject.departmentPhone + ' ' + rowObject.phone + ' '+rowObject.mobile
	                } },
	                { label: '操作', name: '', width: 60, formatter: customActions, fiexed:true },
	            ];
	options.colModel = colModel;
	customGrid.init(options);
}